﻿<%@ Page Language="vb" Culture="en-US" AutoEventWireup="false" MasterPageFile="~/Master_Page/Master_IPORT.Master"
    CodeBehind="frm_Booking.aspx.vb" Inherits="I_PORT.frm_Booking" EnableEventValidation="false"
    Title="IRPC INTELLIGENT PORT SERVICE" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/Control/Confirm.ascx" TagName="Confirm1" TagPrefix="Confirm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:HiddenField ID="postBackClick" runat="server" />
    <script type="text/javascript" language="javascript">
        var _source;
        // keep track of the popup div
        var _popup;

        function showConfirm(customerid) {
            this._source = customerid;
            this._popup = $find('ModalPopupExtender3');
            this._popup.show();
        }
        function okClick() {
            //  find the confirm ModalPopup and hide it
            this._popup.hide();

            __doPostBack(this._source.name, '');

        }

        function cancelClick() {
            //  find the confirm ModalPopup and hide it
            this._popup.hide();
        }
        function closeModal(type) {
            // document.getElementById('ctl00_contentplaceholder1_framePopup').src = 'about:blank';
            if (type == '1') {
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender1');
                mpu.hide();
            }
            else if (type == '2') {
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender2');
                mpu.hide();
            }
            else if (type == 'B') {
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender2');
                mpu.hide();
                document.getElementById('ctl00_contentplaceholder1_btnSaveBooking').click();
            }
            else if (type == 'C') {
                document.getElementById('ctl00_contentplaceholder1_Iframe1').src = '../FormPopup/UploadFile.aspx';
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender4');
                mpu.hide();
            }
            else if (type == 'U') {
                document.getElementById('ctl00_contentplaceholder1_Iframe1').src = '../FormPopup/UploadFile.aspx';
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender4');
                mpu.hide();
                document.getElementById('ctl00_contentplaceholder1_btnSaveUpload').click();
            }
            else if (type == 'P') {
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender5');
                mpu.hide();
                document.getElementById('ctl00_contentplaceholder1_btnSaveProduct').click();
            }
            else if (type == 'D') {
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender5');
                mpu.hide();
            }
            else if (type == '@') {
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender9');
                mpu.hide();
                document.getElementById('ctl00_contentplaceholder1_btnReLoad').click();
            }
            else if (type == 'Y') {
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender6');
                mpu.hide();
            }
            else if (type == 'Z') {
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender6');
                mpu.hide();
                document.getElementById('ctl00_contentplaceholder1_btnSaveCancelBooking').click();
            }
            else {
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender1');
                mpu.hide();
                document.getElementById('ctl00_contentplaceholder1_btnLoad').click();
            }

        }
        function closeModalNew_Service(type) {
            // document.getElementById('ctl00_contentplaceholder1_framePopup').src = 'about:blank';
            if (type == '1') {
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtenderService');
                mpu.hide();
                document.getElementById('ctl00_contentplaceholder1_btnNew_Service_LOAD').click();
            }
            else if (type == '2') {
                var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtenderService');
                mpu.hide();
            }
        }
        function checkNumber(e) {
            var keycode;

            if (window.event) keycode = window.event.keyCode; // ใช้ IE อ่ะ

            else if (e) keycode = e.which; // ใช้ Firefox เน่าะ

            if (((keycode > 47) && (keycode < 58)) || (keycode == 190) || (keycode == 46)) {
                return true;
            }
            return false;
        }

        function tryNumberFormat(obj) {
            obj.value = new NumberFormat(obj.value).toFormatted();
        }
        function clickButton(e, buttonid) {

            var evt = e ? e : window.event;

            var bt = document.getElementById(buttonid);

            if (bt) {

                if (evt.keyCode == 13) {

                    bt.click();

                    return false;

                }

            }

        }

    </script>
    <script src="../jquery-1.5.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
           
			
        });
        function get_id(elm) {
            var id = '[id$=' + elm + ']';
            return id;
        }
    </script>
    <style type="text/css">
        td.locked, th.locked
        {
            position: relative;
            left: expression((this.parentElement.parentElement.parentElement.parentElement.scrollLeft-2)+'px');
        }
        a.linkBtn { padding:2px 5px 3px 5px; text-decoration:none; color:#000; background-color:#f0f0f0 }
        .red-font{ color:Red}
    </style>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        
        <ContentTemplate>
            <asp:Label ID="testLabel" runat="server"></asp:Label>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <%--   <tr>
      <td style="height:6px;background-color:#ffffff"> <img src="../Image/space.gif" /></td>
   </tr>--%>
                <tr>
                    <td>
                        <asp:Panel ID="PanelBookingItem" runat="server">
                            <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                <tr>
                                    <td style="height: 5px;">
                                        <img src="../Image/space.gif" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="left" colspan="2">
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td valign="top">
                                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                        <tr>
                                                            <td align="right" style="width: 100px;">
                                                                <asp:Label ID="label62" runat="server" SkinID="lbtxt" Text="Booking No. :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:TextBox ID="txtBookingVPS" runat="server"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="right" style="width: 100px;">
                                                                <asp:Label ID="label63" runat="server" SkinID="lbtxt" Text="Ship's Name :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:TextBox ID="txtShipVPS" runat="server" Width="80%"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="right" style="width: 100px;">
                                                                <asp:Label ID="label64" runat="server" SkinID="lbtxt" Text="Status :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:DropDownList ID="ddlStatusVPS" runat="server" SkinID="ddl">
                                                                    <asp:ListItem Value="A">Active</asp:ListItem>
                                                                    <asp:ListItem Value="C">Cancel</asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="right" style="width: 100px;">&nbsp;
                                                                
                                                            </td>
                                                            <td align="left">
                                                                <asp:Button ID="btnSearchVPS" runat="server" Text="ค้นหา" CssClass="ButtonStyle" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                                <td valign="top">
                                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                        <tr>
                                                            <td align="right" style="width: 100px;">
                                                                <asp:Label ID="label65" runat="server" SkinID="lbtxt" Text="PORT :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:DropDownList ID="ddlPORTVPS" runat="server" SkinID="ddl">
                                                                    <asp:ListItem Value="0">All</asp:ListItem>
                                                                    <asp:ListItem Value="L">Liquid</asp:ListItem>
                                                                    <asp:ListItem Value="B">Bulk</asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="right" style="width: 100px;">
                                                                <asp:Label ID="label51" runat="server" SkinID="lbtxt" Text="Product :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:TextBox ID="txtProductSearch" runat="server" Width="80%"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="right" style="width: 100px;">
                                                                <asp:Label ID="label66" runat="server" SkinID="lbtxt" Text="Main Agent :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:TextBox ID="txtAGENTVPS" runat="server" Width="80%"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" align="right">
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td>
                                                    &nbsp
                                                </td>
                                                <td style="width: 24px;">
                                                    <img src="../Image/red.png" />
                                                </td>
                                                <td style="width: 90px;" align="left">
                                                    &nbsp<asp:Label ID="Label34" runat="server" SkinID="lbtxt" Text="WAITING VERIFIED"></asp:Label>
                                                </td>
                                                <td style="width: 24px;">
                                                    <img src="../Image/green.png" />
                                                </td>
                                                <td style="width: 60px;" align="left">
                                                    &nbsp<asp:Label ID="Label35" runat="server" SkinID="lbtxt" Text="RELEASED"></asp:Label>
                                                </td>
                                                <td style="width: 24px;">
                                                    <img src="../Image/comment.png" />
                                                </td>
                                                <td style="width: 90px;" align="left">
                                                    &nbsp<asp:Label ID="Label44" runat="server" SkinID="lbtxt" Text="COMMENT"></asp:Label>
                                                </td>
                                                <td style="background-color: #A0CFEC; width: 24px;">&nbsp;
                                                    
                                                </td>
                                                <td style="width: 140px;" align="left">
                                                    &nbsp<asp:Label ID="lb" runat="server" SkinID="lbtxt" Text="LOAD TO DOMESTIC"></asp:Label>
                                                </td>
                                                <td style="background-color: #6698FF; width: 24px;">&nbsp;
                                                    
                                                </td>
                                                <td style="width: 140px;" align="left">
                                                    &nbsp<asp:Label ID="Label30" runat="server" SkinID="lbtxt" Text="LOAD TO FOREIGN"></asp:Label>
                                                </td>
                                                <td style="background-color: #52D017; width: 24px;">&nbsp;
                                                    
                                                </td>
                                                <td style="width: 140px;" align="left">
                                                    &nbsp<asp:Label ID="Label31" runat="server" SkinID="lbtxt" Text="DISCH FROM DOMESTIC"></asp:Label>
                                                </td>
                                                <td style="background-color: #347C17; width: 24px;">&nbsp;
                                                    
                                                </td>
                                                <td style="width: 140px;" align="left">
                                                    &nbsp<asp:Label ID="Label32" runat="server" SkinID="lbtxt" Text="DISCH FROM FOREIGN"></asp:Label>
                                                </td>
                                                <td style="background-color: #FF0000; width: 24px;">&nbsp;
                                                    
                                                </td>
                                                <td style="width: 140px;" align="left">
                                                    &nbsp<asp:Label ID="Label33" runat="server" SkinID="lbtxt" Text="CANCEL BOOKING"></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="height: 5px;">
                                        <img src="../Image/space.gif" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" align="center">
                                        <asp:Panel ID="panelGridItem" runat="server" ScrollBars="Horizontal">
                                            <asp:GridView ID="gridItem" runat="server" SkinID="gridblue" DataKeyNames="Status,Booking_Code,Booking_name,Vehicle_no,Vehicle_Text,Booking_no,Date_From,Date_To,MAgent_no,MAgent_name,SAgent_no,SAgent_name,MKT_Product,MKT_Custom,MKT_Finance,Booking_Date,Booking_Time,VPS_approve,MRI_approve,Marketing_approve,Vps_Acknowledge,MKT_Acknowledge,Remark_VPS,Remark_MRI,Vehicle_Destination,Vehicle_TypeBuy,Demurrage,Demurrage_Money,BunkerFO_Point,BunkerDO_Point,PORT,Confirm_Time,File_Upload,SELLER,BUYER,Product_Unit,Payin"
                                                AutoGenerateColumns="False">
                                                <PagerTemplate>
                                                    <table>
                                                        <tr>
                                                            <td>
                                                                <asp:ImageButton ID="ImgFirst" runat="server" Height="22px" ImageUrl="../Image/arrow-first.gif"
                                                                    OnCommand="Paginate" CommandArgument="First" CommandName="Page" />
                                                            </td>
                                                            <td>
                                                                <asp:ImageButton ID="ImgBack" runat="server" Height="22px" ImageUrl="../Image/arrow-back.gif"
                                                                    OnCommand="Paginate" CommandArgument="Prev" CommandName="Page" />
                                                            </td>
                                                            <td valign="top">
                                                                Page
                                                                <asp:DropDownList ID="ddlPage" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPage_SelectedIndexChanged">
                                                                </asp:DropDownList>
                                                                of
                                                                <asp:Label ID="lbPageCount" runat="server" Text="Label"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:ImageButton ID="ImgNext" runat="server" Height="22px" ImageUrl="../Image/arrow-next.gif"
                                                                    OnCommand="Paginate" CommandArgument="Next" CommandName="Page" />
                                                            </td>
                                                            <td>
                                                                <asp:ImageButton ID="ImgEnd" runat="server" Height="22px" ImageUrl="../Image/arrow-end.gif"
                                                                    OnCommand="Paginate" CommandArgument="Last" CommandName="Page" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </PagerTemplate>
                                                <Columns>
                                                    <asp:TemplateField HeaderText="BOOKING NO." ItemStyle-Wrap="false" ItemStyle-CssClass="locked">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="LinkBooking" runat="server" Text="<%# Bind('Booking_no') %>"
                                                                 CommandName="Edit"></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField HeaderText="Vessel NAME" DataField="Vehicle_Text" ItemStyle-Wrap="false"
                                                        ItemStyle-CssClass="locked" />
                                                    <asp:BoundField HeaderText="Status" ItemStyle-Wrap="false" />
                                                    <asp:BoundField HeaderText="LAY CAN/LAY DAY" DataField="Date_To" ItemStyle-Wrap="false" />
                                                    <asp:BoundField HeaderText="วันเวลา/จองเข้า" DataField="Lay_Time" ItemStyle-Wrap="false" />
                                                    <asp:BoundField HeaderText="LAY TIME" DataField="Lay_Time" ItemStyle-Wrap="false" HtmlEncode="false" ItemStyle-VerticalAlign="Middle" />
                                                    <asp:BoundField HeaderText="เอกสารรายละเอียด" DataField="File_Upload" ItemStyle-Wrap="false" />
                                                    <asp:BoundField HeaderText="COMMODITY" DataField="Product_Name" ItemStyle-Wrap="false" />
                                                    <asp:BoundField HeaderText="QUANTITY" DataField="Product_Amount" ItemStyle-Wrap="false" />
                                                    <asp:BoundField HeaderText="UNIT" DataField="Product_Unit" ItemStyle-Wrap="false" />
                                                    <asp:BoundField HeaderText="BUYER" DataField="BUYER" ItemStyle-Wrap="false" />
                                                    <asp:BoundField HeaderText="SALLER" DataField="SELLER" ItemStyle-Wrap="false" />
                                                    <asp:BoundField HeaderText="Status" DataField="Status_Text" Visible="false" />
                                                    <asp:TemplateField HeaderText="Product" ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                                                        <ItemTemplate>
                                                            <asp:Image ID="imgProduct" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Custom" ItemStyle-Width="40px">
                                                        <ItemTemplate>
                                                            <asp:Image ID="imgCustom" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Finace" ItemStyle-Width="40px">
                                                        <ItemTemplate>
                                                            <asp:Image ID="imgFinance" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField HeaderText="DEMURRAGE" DataField="Lay_Time" />
                                                    <asp:BoundField HeaderText="TERM" DataField="Lay_Time" />
                                                    <asp:TemplateField HeaderText="VPS" ItemStyle-Width="40px">
                                                        <ItemTemplate>
                                                            <asp:Image ID="imgVPS" runat="server" /><asp:Image ID="imgVPSComment" runat="server"
                                                                ImageUrl="~/Image/comment.png" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="MRI" ItemStyle-Width="40px">
                                                        <ItemTemplate>
                                                            <asp:Image ID="imgMRI" runat="server" /><asp:Image ID="imgMRIComment" runat="server"
                                                                ImageUrl="~/Image/comment.png" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="MKT" ItemStyle-Width="40px">
                                                        <ItemTemplate>
                                                            <asp:Image ID="imgMKT" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField HeaderText="AGENT" DataField="MAgent_name" ItemStyle-Font-Size="12px" HtmlEncode="false"/>
                                                    <asp:BoundField HeaderText="เทียบท่า" DataField="Wharf" />
                                                    <asp:BoundField HeaderText="วันเทียบ" DataField="Date_Wharf" />
                                                    <asp:BoundField HeaderText="เวลาเทียบ" DataField="TimeStart" />
                                                    <asp:BoundField HeaderText="เวลาเทียบ" DataField="Date_WharfEnd" />
                                                    <asp:BoundField HeaderText="เวลาเทียบ" DataField="TimeEnd" />
                                                    <asp:TemplateField HeaderText="Confirm" ItemStyle-Width="40px">
                                                        <ItemTemplate>
                                                            <asp:Image ID="imgConfrim" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField HeaderText="REMAIN LAYTIME" />
                                                    <asp:BoundField HeaderText="REMARK" DataField="RemarkWharf" />
                                                    <asp:TemplateField HeaderText="" ItemStyle-Width="105px">
                                                        <ItemTemplate>
                                                            <%--<asp:Button ID="btnDetail" runat="server" Text="Detail" CssClass="ButtonStyle"
                                                                CommandName="Detail" style="width:70px" OnClick="btnDetail_Click"  />--%>
                                                            <asp:LinkButton ID="DetailLbtn" runat="server" Text="Detail"
                                                                 CommandName="Detail" CssClass="ButtonStyle linkBtn"></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                            <asp:Timer ID="Timer1" Interval="300000" runat="server">
                                            </asp:Timer>
                                        </asp:Panel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 5%;" align="right">&nbsp;
                                        
                                    </td>
                                    <td align="left">
                                        <asp:Button ID="btnNew" runat="server" CssClass="ButtonStyle" Text="New Booking" />
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        <asp:Panel ID="PanelBooking" runat="server">
                            <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                <tr>
                                    <td>
                                        <asp:Panel ID="PORT" runat="server">
                                            <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                <tr>
                                                    <td style="width: 220px;" align="right">
                                                        <asp:Label ID="Label29" runat="server" SkinID="lbtxt" Text="REQUESTER :"></asp:Label>&nbsp;
                                                    </td>
                                                    <td align="left">
                                                    <div style="float:left;">
                                                        <asp:TextBox ID="txtName" runat="server" Width="350px" Enabled="false"></asp:TextBox><input
                                                            type="hidden" id="hdfUsername" runat="server" />
                                                     </div>
                                                         <div style="float:right;">
                                                             <asp:Button ID="btnViewChildBooking" style="width:250px" runat="server" 
                                                                 Text="ดูข้อมูล Child Booking" CssClass="ButtonStyle" Visible="false" />
                                                         </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="width: 220px;" align="right">
                                                        <asp:Label ID="labelRed" runat="server" Text="*" ForeColor="Red"></asp:Label><asp:Label
                                                            ID="Label24" runat="server" SkinID="lbtxt" Text="TERMINAL :"></asp:Label>&nbsp;
                                                    </td>
                                                    <td align="left">
                                                        <asp:RadioButtonList ID="radioPort" runat="server" SkinID="raio" AutoPostBack="true"
                                                            RepeatDirection="Horizontal">
                                                            <asp:ListItem Value="L">Liquid</asp:ListItem>
                                                            <asp:ListItem Value="B">Bulk</asp:ListItem>
                                                        </asp:RadioButtonList>
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top">
                                        <asp:Panel ID="PanelVessel" runat="server" Visible="false">
                                            <asp:UpdatePanel ID="UPDATEVERHICLE" runat="server" UpdateMode="Conditional">
                                                <ContentTemplate>
                                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                        <tr>
                                                            <td style="width: 220px;" align="right">
                                                                <asp:Label ID="lbID" runat="server" SkinID="lbtxt" Text="Main Agent(SoldTo) :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:TextBox ID="txtid" runat="server" Width="350px"></asp:TextBox>
                                                                <asp:AutoCompleteExtender runat="server" ID="AutoCompleteExtender1" BehaviorID="AutoCompleteEx2"
                                                                    CompletionInterval="50" TargetControlID="txtid" ServicePath="../WebService/AutoComplete_IPORT.asmx"
                                                                    MinimumPrefixLength="1" ServiceMethod="GetCustomer" CompletionListCssClass="autocomplete_completionListElement"
                                                                    CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem">
                                                                    <Animations>
                    <OnShow>
                        <Sequence>
                            <%-- Make the completion list transparent and then show it --%>
                            <OpacityAction Opacity="0" />
                            <HideAction Visible="true" />
                            
                            <%--Cache the original size of the completion list the first time
                                the animation is played and then set it to zero --%>
                            <ScriptAction Script="
                                // Cache the size and setup the initial size
                                var behavior = $find('AutoCompleteEx2');
                                if (!behavior._height) {
                                    var target = behavior.get_completionList();
                                    behavior._height = target.offsetHeight - 2;
                                    target.style.height = '0px';
                                }" />
                            
                            <%-- Expand from 0px to the appropriate size while fading in --%>
                            <Parallel Duration=".3">
                                <FadeIn />
                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx2')._height" />
                            </Parallel>
                        </Sequence>
                    </OnShow>
                    <OnHide>
                        <%-- Collapse down to 0px and fade out --%>
                        <Parallel Duration=".3">
                            <FadeOut />
                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx2')._height" EndValue="0" />
                        </Parallel>
                    </OnHide>
                                                                    </Animations>
                                                                </asp:AutoCompleteExtender>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="width: 220px;" align="right">
                                                                <asp:Label ID="Label28" runat="server" SkinID="lbtxt" Text="Sub Agent(ผู้ดำเนินการแทน) :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:TextBox ID="txtAgent" runat="server" Width="350px"></asp:TextBox>
                                                                <asp:AutoCompleteExtender runat="server" ID="AutoCompleteExtender2" BehaviorID="AutoCompleteEx4"
                                                                    CompletionInterval="50" TargetControlID="txtAgent" ServicePath="../WebService/AutoComplete_IPORT.asmx"
                                                                    MinimumPrefixLength="1" ServiceMethod="GetCustomer" CompletionListCssClass="autocomplete_completionListElement"
                                                                    CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem">
                                                                    <Animations>
                    <OnShow>
                        <Sequence>
                            <%-- Make the completion list transparent and then show it --%>
                            <OpacityAction Opacity="0" />
                            <HideAction Visible="true" />
                            
                            <%--Cache the original size of the completion list the first time
                                the animation is played and then set it to zero --%>
                            <ScriptAction Script="
                                // Cache the size and setup the initial size
                                var behavior = $find('AutoCompleteEx4');
                                if (!behavior._height) {
                                    var target = behavior.get_completionList();
                                    behavior._height = target.offsetHeight - 2;
                                    target.style.height = '0px';
                                }" />
                            
                            <%-- Expand from 0px to the appropriate size while fading in --%>
                            <Parallel Duration=".3">
                                <FadeIn />
                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx4')._height" />
                            </Parallel>
                        </Sequence>
                    </OnShow>
                    <OnHide>
                        <%-- Collapse down to 0px and fade out --%>
                        <Parallel Duration=".3">
                            <FadeOut />
                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx4')._height" EndValue="0" />
                        </Parallel>
                    </OnHide>
                                                                    </Animations>
                                                                </asp:AutoCompleteExtender>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="width: 220px;" align="right" valign="top">
                                                                <asp:Label ID="label46" runat="server" Text="*" ForeColor="Red"></asp:Label><asp:Label
                                                                    ID="lbVessel" runat="server" SkinID="lbtxt" Text="SHIP NAME :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:Panel ID="PanelVEHICLE_IN" runat="server">
                                                                    <asp:TextBox ID="txtVessel" runat="server" Width="350px"></asp:TextBox>&nbsp;<asp:Button
                                                                        ID="btnSearch" runat="server" Text="Select" CssClass="ButtonStyle" />
                                                                    <asp:AutoCompleteExtender runat="server" ID="autoComplete1" BehaviorID="AutoCompleteEx"
                                                                        CompletionInterval="50" TargetControlID="txtVessel" ServicePath="../WebService/AutoComplete_IPORT.asmx"
                                                                        MinimumPrefixLength="1" ServiceMethod="GetVessel" CompletionListCssClass="autocomplete_completionListElement"
                                                                        CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem">
                                                                        <Animations>
                    <OnShow>
                        <Sequence>
                            <%-- Make the completion list transparent and then show it --%>
                            <OpacityAction Opacity="0" />
                            <HideAction Visible="true" />
                            
                            <%--Cache the original size of the completion list the first time
                                the animation is played and then set it to zero --%>
                            <ScriptAction Script="
                                // Cache the size and setup the initial size
                                var behavior = $find('AutoCompleteEx');
                                if (!behavior._height) {
                                    var target = behavior.get_completionList();
                                    behavior._height = target.offsetHeight - 2;
                                    target.style.height = '0px';
                                }" />
                            
                            <%-- Expand from 0px to the appropriate size while fading in --%>
                            <Parallel Duration=".3">
                                <FadeIn />
                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
                            </Parallel>
                        </Sequence>
                    </OnShow>
                    <OnHide>
                        <%-- Collapse down to 0px and fade out --%>
                        <Parallel Duration=".3">
                            <FadeOut />
                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
                        </Parallel>
                    </OnHide>
                                                                        </Animations>
                                                                    </asp:AutoCompleteExtender>
                                                                </asp:Panel>
                                                                <asp:Panel ID="PanelVEHICLE_OUT" runat="server" Visible="false">
                                                                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                                        <tr>
                                                                            <td>
                                                                                <asp:TextBox ID="txtVesselOUT" runat="server" Width="350px"></asp:TextBox>&nbsp;<asp:Button
                                                                                    ID="btnSearchOUT" runat="server" Text="Select" CssClass="ButtonStyle" />
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td align="left">
                                                                                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                                                    <tr>
                                        
                                          <td align="right">
                                            <asp:Label ID="Label4" runat="server" SkinID="lbtxt" Text="L.O.A :"></asp:Label></td>
                                          <td style="width:180px;" align="left"> <asp:TextBox ID="txtLOA" runat="server" Width="140px" onkeypress="return checkNumber(this);">
                                            </asp:TextBox>&nbsp;&nbsp;<asp:Label ID="lbFT1" runat="server" SkinID="lbtxt" Text="FT"></asp:Label>
                                          </td>
                                          <td class="red-font">** ข้อมูล LOA หาจากเอกสาร Q88 หัวข้อที่ 1.25</td>
                                       </tr>
                                       <tr>
                                          <td align="right">
                                            <asp:Label ID="Label9" runat="server" SkinID="lbtxt" Text="DWT :"></asp:Label></td>
                                          <td align="left"> 
                                            <asp:TextBox ID="txtDWT" runat="server" Width="140px" onkeypress="return checkNumber(this);"></asp:TextBox>&nbsp;
                                            <asp:Label ID="Label19" runat="server" SkinID="lbtxt" Text="MT"></asp:Label></td>
                                            <td class="red-font">** ข้อมูล DWT หาจากเอกสาร Q88 หัวข้อที่ 1.39(SUMMER)</td>
                                       </tr>
                                       <tr>
                                          <td align="right">
                                            <asp:Label ID="Label5" runat="server" SkinID="lbtxt" Text="Draft :"></asp:Label>
                                          </td>
                                          <td align="left"> 
                                            <asp:TextBox ID="txtDraft" runat="server" Width="140px" onkeypress="return checkNumber(this);"></asp:TextBox>&nbsp;
                                            <asp:Label ID="lbFT2" runat="server" SkinID="lbtxt" Text="FT"></asp:Label>
                                          </td>
                                          <td class="red-font">** ข้อมูล Draft หาจากเอกสาร Q88 หัวข้อที่ 1.39(SUMMER)</td>
                                       </tr>
                                       <tr>
                                          <td align="right">
                                            <asp:Label ID="Label6" runat="server" SkinID="lbtxt" Text="GRT :"></asp:Label>
                                          </td>
                                          <td align="left"> 
                                            <asp:TextBox ID="txtGRT" runat="server" Width="140px" onkeypress="return checkNumber(this);"></asp:TextBox>&nbsp;
                                            <asp:Label ID="Label23" runat="server" SkinID="lbtxt" Text="MT"></asp:Label>
                                          </td>
                                          <td class="red-font">** ข้อมูล GRT หาจากเอกสาร Q88 หัวข้อที่ 1.36</td>
                                       </tr>
                                                                                    <tr>
                                                                                        <td style="width: 60px;" align="right">
                                                                                            <asp:Label ID="Label25" runat="server" SkinID="lbtxt" Text="FLAG :"></asp:Label>
                                                                                        </td>
                                                                                        <td style="width: 220px;" align="left">
                                                                                            <asp:DropDownList ID="ddlNation" runat="server" SkinID="ddl">
                                                                                                <asp:ListItem Value="T">THAI</asp:ListItem>
                                                                                                <asp:ListItem Value="O">OTHER</asp:ListItem>
                                                                                            </asp:DropDownList>
                                                                                        </td>
                                                                                        <td colspan="3">&nbsp;
                                                                                            
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td style="width: 60px;" align="right">
                                                                                            <asp:Label ID="Label56" runat="server" SkinID="lbtxt" Text=""></asp:Label>
                                                                                        </td>
                                                                                        <td colspan="4" align="left">
                                                                                            <asp:Label ID="label57" runat="server" Text="** ข้อมูล LOA และ DRAFT กรุณาทำการใส่ค่าเป็น FT (FT = M * 3.281)"
                                                                                                ForeColor="Red"></asp:Label>&nbsp;
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </asp:Panel>
                                                                <asp:Panel ID="PanelVEHICLE_IN_DETAIL" runat="server" Visible="false">
                                                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                                        <tr>
                                                                            <td style="width: 60px;" align="right">
                                                                                <asp:Label ID="Label13" runat="server" SkinID="lbtxt" Text="L.O.A :"></asp:Label>
                                                                            </td>
                                                                            <td style="width: 220px;" align="left">
                                                                                <asp:Label ID="lbLOA" runat="server" SkinID="lbtxt"></asp:Label>&nbsp;<asp:Label
                                                                                    ID="Label10" runat="server" SkinID="lbtxt" Text="FT"></asp:Label>
                                                                            </td>
                                                                            <td style="width: 90px;" align="right">
                                                                                <asp:Label ID="Label14" runat="server" SkinID="lbtxt" Text="DWT :"></asp:Label>
                                                                            </td>
                                                                            <td style="width: 220px;" align="left">
                                                                                <asp:Label ID="lbDWT" runat="server" SkinID="lbtxt"></asp:Label>&nbsp;<asp:Label
                                                                                    ID="Label11" runat="server" SkinID="lbtxt" Text="FT"></asp:Label>
                                                                            </td>
                                                                            <td>&nbsp;
                                                                                
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td style="width: 60px;" align="right">
                                                                                <asp:Label ID="Label15" runat="server" SkinID="lbtxt" Text="Draft :"></asp:Label>
                                                                            </td>
                                                                            <td style="width: 220px;" align="left">
                                                                                <asp:Label ID="lbDraft" runat="server" SkinID="lbtxt"></asp:Label>&nbsp;<asp:Label
                                                                                    ID="Label12" runat="server" SkinID="lbtxt" Text="FT"></asp:Label>
                                                                            </td>
                                                                            <td style="width: 90px;" align="right">
                                                                                <asp:Label ID="Label16" runat="server" SkinID="lbtxt" Text="GRT :"></asp:Label>
                                                                            </td>
                                                                            <td style="width: 220px;" align="left">
                                                                                <asp:Label ID="lbGRT" runat="server" SkinID="lbtxt"></asp:Label>&nbsp;<asp:Label
                                                                                    ID="Label17" runat="server" SkinID="lbtxt" Text="MT"></asp:Label>
                                                                            </td>
                                                                            <td>&nbsp;
                                                                                
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td style="width: 60px;" align="right">
                                                                                <asp:Label ID="Label27" runat="server" SkinID="lbtxt" Text="Nationality :"></asp:Label>
                                                                            </td>
                                                                            <td style="width: 220px;" align="left">
                                                                                <asp:Label ID="lbNation" runat="server" SkinID="lbtxt"></asp:Label>
                                                                            </td>
                                                                            <td colspan="3">&nbsp;
                                                                                
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </asp:Panel>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="width: 220px;" align="right">
                                                                <asp:Label ID="Label8" runat="server" SkinID="lbtxt" Text="SHIP MASTER :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:RadioButtonList ID="radioVehicle" runat="server" SkinID="raio" RepeatDirection="Horizontal"
                                                                    AutoPostBack="true">
                                                                    <asp:ListItem Selected="True" Value="0">IN RECORD</asp:ListItem>
                                                                    <asp:ListItem Value="1">OFF RECORD</asp:ListItem>
                                                                </asp:RadioButtonList>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </ContentTemplate>
                                            </asp:UpdatePanel>
                                        </asp:Panel>
                                        <asp:Panel ID="PanelDetail" runat="server">
                                            <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                <tr>
                                                    <td style="width: 220px;" align="right">
                                                        <asp:Label ID="label49" runat="server" Text="*" ForeColor="Red"></asp:Label><asp:Label
                                                            ID="Label2" runat="server" SkinID="lbtxt" Text="Lay Can/Lay Day :"></asp:Label>&nbsp;
                                                    </td>
                                                    <td align="left">
                                                        <asp:TextBox ID="txtDate" runat="server" Width="80px" onkeypress="return false;"></asp:TextBox>&nbsp;<asp:ImageButton
                                                            ID="ImgDate" runat="server" ImageUrl="~/Image/calendar.png" />&nbsp;<asp:Label ID="Label3"
                                                                runat="server" SkinID="lbtxt" Text="TO"></asp:Label>&nbsp;<asp:TextBox ID="txtDateTo"
                                                                    runat="server" Width="80px" onkeypress="return false;"></asp:TextBox>&nbsp;<asp:ImageButton
                                                                        ID="ImgDateTo" runat="server" ImageUrl="~/Image/calendar.png" />&nbsp;<asp:Label
                                                                            ID="label58" runat="server" CssClass="lbtxtNoColor" Text="*กรุณาทำการอัพเดตให้เป็นปัจจุบัน"
                                                                            ForeColor="Red"></asp:Label>
                                                        <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate"
                                                            Format="dd MMM yyyy" PopupButtonID="ImgDate">
                                                        </asp:CalendarExtender>
                                                        <asp:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtDateTo"
                                                            Format="dd MMM yyyy" PopupButtonID="ImgDateTo">
                                                        </asp:CalendarExtender>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="width: 220px;" align="right">
                                                        <asp:Label ID="Label48" runat="server" SkinID="lbtxt" Text="REQUIRE DATE/TIME:"></asp:Label>&nbsp;
                                                    </td>
                                                    <td align="left">
                                                        <asp:TextBox ID="txtDateBooking" runat="server" Width="80px" onkeypress="return false;"></asp:TextBox>&nbsp;<asp:ImageButton
                                                            ID="ImgDateBooking" runat="server" ImageUrl="~/Image/calendar.png" />&nbsp;<asp:TextBox
                                                                ID="txtTimeBooking" runat="server" Width="40px"></asp:TextBox>
                                                        <asp:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtDateBooking"
                                                            Format="dd MMM yyyy" PopupButtonID="ImgDateBooking">
                                                        </asp:CalendarExtender>
                                                        <asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="txtTimeBooking"
                                                            Mask="99:99" MaskType="Time" AcceptNegative="Left" InputDirection="LeftToRight">
                                                        </asp:MaskedEditExtender>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="width: 220px;" align="right">
                                                        <asp:Label ID="label54" runat="server" Text="*" ForeColor="Red"></asp:Label><asp:Label
                                                            ID="Label55" runat="server" SkinID="lbtxt" Text="Demurrage :"></asp:Label>&nbsp;
                                                    </td>
                                                    <td align="left">
                                                        <asp:RadioButtonList ID="radioDemurrage" runat="server" AutoPostBack="true" SkinID="raio"
                                                            RepeatDirection="Horizontal">
                                                            <asp:ListItem Value="Y">Yes</asp:ListItem>
                                                            <asp:ListItem Selected="True" Value="N">No</asp:ListItem>
                                                        </asp:RadioButtonList>
                                                    </td>
                                                </tr>
                                            </table>
                                            <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                <tr id="rowLaytime" runat="server" visible="false">
                                                    <td colspan="2">
                                                        <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                            <tr>
                                                                <td style="width: 220px;" align="right">
                                                                    <asp:Label ID="Label45" runat="server" SkinID="lbtxt" Text="Lay Time :"></asp:Label>&nbsp;
                                                                </td>
                                                                <td align="left">
                                                                    <asp:TextBox ID="txtLayTime" runat="server" Width="40px" Text="0"></asp:TextBox>&nbsp;<asp:Label
                                                                        ID="lbLaytime" runat="server" SkinID="lbtxt" Text="Hours"></asp:Label>&nbsp;<asp:Label
                                                                            ID="label59" runat="server" CssClass="lbtxtNoColor" Text="*กรุณาทำการระบุเวลาที่ใช้เข้าสู่ท่าเรือ IRPC เท่านั้น"
                                                                            ForeColor="Red"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="width: 220px;" align="right">
                                                                    <asp:Label ID="Label52" runat="server" SkinID="lbtxt" Text="Demurrage :"></asp:Label>&nbsp;
                                                                </td>
                                                                <td align="left">
                                                                    <asp:TextBox ID="txtDemurrage" runat="server" Text="0" MaxLength="50" onkeypress="tryNumberFormat(this);"></asp:TextBox>&nbsp;<asp:DropDownList
                                                                        ID="ddlDemurrage" runat="server" SkinID="raio" RepeatDirection="Horizontal">
                                                                        <asp:ListItem Value="B">BAHT</asp:ListItem>
                                                                        <asp:ListItem Value="U">USD</asp:ListItem>
                                                                    </asp:DropDownList>
                                                                    &nbsp;<asp:Label ID="lbPDPR" Text="PDPR" runat="server" SkinID="lbtxt"></asp:Label>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </td>
                                </tr>
                                <tr id="rowDetailAll" runat="server" visible="false">
                                    <td>
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td colspan="2">
                                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                        <tr>
                                                            <td style="width: 220px;" align="right">&nbsp;
                                                                
                                                            </td>
                                                            <td align="left">
                                                                <asp:Button ID="btnSaveProduct" runat="server" Text="xx" Style="display: none;" />
                                                                <asp:Button ID="btnProduct" runat="server" Text="ADD PRODUCT" CssClass="ButtonStyle" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="width: 220px;" align="right">&nbsp;
                                                                
                                                            </td>
                                                            <td align="left">
                                                                <table width="90%" border="0" cellpadding="0" cellspacing="0">
                                                                    <tr>
                                                                        <td>
                                                                            <asp:GridView ID="gridProduct" runat="server" SkinID="gridblueNoPage" DataKeyNames="Product_no,Product_name,Product_Event,Group_no,Product_BUYER_no,Product_SELLER_no,Product_Unit"
                                                                                AutoGenerateColumns="False">
                                                                                <Columns>
                                                                                    <asp:BoundField HeaderText="Operation" DataField="Product_Event" />
                                                                                    <asp:BoundField HeaderText="Product Group" DataField="Group_name" />
                                                                                    <asp:BoundField HeaderText="Product" DataField="Product_name" />
                                                                                    <asp:BoundField HeaderText="Amount" DataField="Product_Amount" ItemStyle-HorizontalAlign="Center"
                                                                                        ItemStyle-Width="80px" />
                                                                                    <asp:BoundField HeaderText="Unit" DataField="Product_Unit" />
                                                                                    <asp:BoundField HeaderText="BUYER" DataField="Product_BUYER_name" />
                                                                                    <asp:BoundField HeaderText="SELLER" DataField="Product_SELLER_name" />
                                                                                    <asp:BoundField HeaderText="เจ้าของสินค้า" DataField="Owner_Product_name" Visible="false" />
                                                                                    <asp:BoundField HeaderText="Destination" DataField="DestinationShow" />
                                                                                    <asp:BoundField HeaderText="Detail" DataField="Product_Description" />
                                                                                    <asp:TemplateField HeaderText="Edit" ItemStyle-Width="50px">
                                                                                        <ItemTemplate>
                                                                                            <asp:ImageButton ID="imgedit" CommandName="cmdedit" CommandArgument="<%# Container.DataItemIndex %>"
                                                                                                runat="server" ImageUrl="~/Image/edit-24.gif" />
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateField>
                                                                                    <asp:TemplateField HeaderText="Delete" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
                                                                                        <ItemTemplate>
                                                                                            <asp:ImageButton ID="imgdelete" CommandName="cmddelete" CommandArgument="<%# Container.DataItemIndex %>"
                                                                                                OnClientClick="showConfirm(this); return false;" runat="server" ImageUrl="~/Image/cancel-24.gif" />
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateField>
                                                                                </Columns>
                                                                            </asp:GridView>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <asp:UpdatePanel ID="PanelBunker" runat="server" UpdateMode="Conditional">
                                                        <ContentTemplate>
                                                            <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                                <tr>
                                                                    <td style="width: 220px;" align="right">
                                                                        <asp:Label ID="label22" runat="server" Text="*" ForeColor="Red"></asp:Label><asp:Label
                                                                            ID="lbType" runat="server" SkinID="lbtxt" Text="Destination :"></asp:Label>&nbsp;
                                                                    </td>
                                                                    <td align="left" colspan="5">
                                                                        <asp:RadioButtonList ID="raioType" runat="server" SkinID="raio" AutoPostBack="true"
                                                                            RepeatDirection="Horizontal">
                                                                            <asp:ListItem Selected="True" Value="I">DOMESTIC</asp:ListItem>
                                                                            <asp:ListItem Value="O">FOREIGN</asp:ListItem>
                                                                        </asp:RadioButtonList>
                                                                    </td>
                                                                </tr>
                                                                <tr id="rowTypeBuy" runat="server" visible="false">
                                                                    <td colspan="6">
                                                                        <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                                            <tr>
                                                                                <td style="width: 220px;" align="right">
                                                                                    <asp:Label ID="label18" runat="server" Text="*" ForeColor="Red"></asp:Label><asp:Label
                                                                                        ID="Label26" runat="server" SkinID="lbtxt" Text="รูปแบบการซื้อขาย :"></asp:Label>&nbsp;
                                                                                </td>
                                                                                <td align="left">
                                                                                    <asp:RadioButtonList ID="radioTypeBuy" runat="server" SkinID="raio" RepeatDirection="Horizontal">
                                                                                        <asp:ListItem Value="F">FOB</asp:ListItem>
                                                                                        <asp:ListItem Value="C">CFR</asp:ListItem>
                                                                                        <asp:ListItem Value="I">CIF</asp:ListItem>
                                                                                        <asp:ListItem Value="O">อื่นๆ</asp:ListItem>
                                                                                    </asp:RadioButtonList>
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="width: 220px;" align="right">
                                                                        <asp:Label ID="Label36" runat="server" SkinID="lbtxt" Text="Request Bunker :"></asp:Label>&nbsp;
                                                                    </td>
                                                                    <td align="left" style="width: 50px">
                                                                        <asp:CheckBox ID="chkFO" runat="server" SkinID="chk" Text="FO" />
                                                                    </td>
                                                                    <td style="width: 45px;">
                                                                        <asp:Label ID="Label37" runat="server" SkinID="lbtxt" Text="AMOUNT"></asp:Label>
                                                                    </td>
                                                                    <td style="width: 40px;">
                                                                        <asp:TextBox ID="txtFO" runat="server" Width="35px" Text="0" MaxLength="10" onkeypress="return checkNumber(this);"></asp:TextBox>&nbsp<asp:Label
                                                                            ID="Label38" runat="server" SkinID="lbtxt" Text="UNIT"></asp:Label>
                                                                    </td>
                                                                    <td align="left" style="width: 60px">
                                                                        <asp:Label ID="Label39" runat="server" SkinID="lbtxt" Text="REMARK"></asp:Label>&nbsp;
                                                                    </td>
                                                                    <td rowspan="2" valign="top" align="left">
                                                                        <asp:TextBox ID="txtBunkerDetail" runat="server" TextMode="MultiLine" Height="50px"
                                                                            Width="300px"></asp:TextBox>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="width: 220px;" align="right">&nbsp;
                                                                        
                                                                    </td>
                                                                    <td align="left">
                                                                        <asp:CheckBox ID="chkDO" runat="server" SkinID="chk" Text="DO" />
                                                                    </td>
                                                                    <td style="width: 45px">
                                                                        <asp:Label ID="Label40" runat="server" SkinID="lbtxt" Text="AMOUNT"></asp:Label>
                                                                    </td>
                                                                    <td style="width: 45px">
                                                                        <asp:TextBox ID="txtDO" Width="35px" runat="server" Text="0" MaxLength="10" onkeypress="return checkNumber(this);"></asp:TextBox>&nbsp;<asp:Label
                                                                            ID="Label41" runat="server" SkinID="lbtxt" Text="UNIT"></asp:Label>
                                                                    </td>
                                                                    <td>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </ContentTemplate>
                                                    </asp:UpdatePanel>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <asp:UpdatePanel ID="updatePanelWater" runat="server" UpdateMode="Conditional">
                                                        <ContentTemplate>
                                                            <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                                <tr>
                                                                    <td style="width: 220px;" align="right">
                                                                        <asp:Label ID="Label42" runat="server" SkinID="lbtxt" Text="Request Water :"></asp:Label>&nbsp;
                                                                    </td>
                                                                    <td align="left">
                                                                        <asp:TextBox ID="txtWater" Width="35px" runat="server" Text="0" MaxLength="10" onkeypress="return checkNumber(this);"></asp:TextBox>&nbsp;<asp:Label
                                                                            ID="LabelWater" runat="server" SkinID="lbtxt" Text="TON"></asp:Label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="width: 220px;" align="right">
                                                                        <asp:Label ID="Label47" runat="server" SkinID="lbtxt" Text="Request Electricity :"></asp:Label>&nbsp;
                                                                    </td>
                                                                    <td align="left">
                                                                        <asp:TextBox ID="txtElectricity" Width="35px" runat="server" Text="0" MaxLength="10"
                                                                            onkeypress="return checkNumber(this);"></asp:TextBox>&nbsp;<asp:Label ID="Label53"
                                                                                runat="server" SkinID="lbtxt" Text="KWH"></asp:Label>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </ContentTemplate>
                                                    </asp:UpdatePanel>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                        <tr>
                                                            <td style="width: 220px;" align="right">
                                                                <asp:Label ID="label50" runat="server" Text="*" ForeColor="Red"></asp:Label><asp:Label
                                                                    ID="Label43" runat="server" SkinID="lbtxt" Text="ATTACHMENT :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:Button ID="btnSaveUpload" runat="server" Style="display: none;" />
                                                                <asp:Button ID="btnUpload" runat="server" Text="Upload" CssClass="ButtonStyle" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="right">
                                                            </td>
                                                            <td align="left">
                                                                <asp:GridView ID="gridfile" runat="server" SkinID="gridblueNoPage" DataKeyNames="File_nameGuid,File_ContentType,File_name,File_Type"
                                                                    AutoGenerateColumns="False">
                                                                    <Columns>
                                                                        <asp:TemplateField HeaderStyle-Wrap="false" HeaderText="File Name">
                                                                            <ItemTemplate>
                                                                                <asp:LinkButton ID="linkID" runat="server" Text="<%# Bind('File_name') %>" CommandArgument="<%# Container.DataItemIndex %>"
                                                                                    CommandName="Select"></asp:LinkButton>
                                                                            </ItemTemplate>
                                                                            <HeaderStyle Wrap="False" />
                                                                            <ItemStyle HorizontalAlign="Center" />
                                                                        </asp:TemplateField>
                                                                        <asp:BoundField HeaderText="นามสกุล" DataField="File_type" />
                                                                        <asp:BoundField HeaderText="Type" DataField="Upload_Type" />
                                                                        <asp:BoundField HeaderText="รายละเอียด" DataField="Description" />
                                                                        <asp:TemplateField HeaderText="ลบ" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
                                                                            <ItemTemplate>
                                                                                <asp:ImageButton ID="imgdelete" CommandName="cmddelete" CommandArgument="<%# Container.DataItemIndex %>"
                                                                                    OnClientClick="showConfirm(this); return false;" runat="server" ImageUrl="~/Image/cancel-24.gif" />
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                    </Columns>
                                                                </asp:GridView>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                        <tr id="rowRemarkVPS" runat="server" visible="false" valign="top">
                                                            <td style="width: 220px;" align="right">
                                                                <asp:Label ID="Label20" runat="server" SkinID="lbtxt" Text="REMARK FROM VPS :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:Label ID="lbRemark_VPS" runat="server" SkinID="lbtxt"></asp:Label>
                                                            </td>
                                                        </tr>
                                                        <tr id="rowRemarkMRI" runat="server" visible="false" valign="top">
                                                            <td style="width: 220px;" align="right">
                                                                <asp:Label ID="Label21" runat="server" SkinID="lbtxt" Text="REMARK FROM MRI :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:Label ID="lbRemark_MRI" runat="server" SkinID="lbtxt"></asp:Label>
                                                            </td>
                                                        </tr>
                                                        <tr id="rowCancel" runat="server" visible="false" valign="top">
                                                            <td style="width: 220px;" align="right" valign="top">
                                                                <asp:Label ID="Label7" runat="server" SkinID="lbtxt" Text="CAUSE CANCELLATION :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:Label ID="lbCancel" runat="server" SkinID="lbtxt"></asp:Label>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="width: 220px;" align="right" valign="top">
                                                                <asp:Label ID="Label1" runat="server" SkinID="lbtxt" Text="REMARK :"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left" valign="top">
                                                                <asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine" Height="70px" Width="90%"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr id="ComputeTariff" runat="server">
                                                <td colspan="2">
                                                    <asp:UpdatePanel ID="UpdatePanelTariff" runat="server" UpdateMode="Conditional">
                                                        <ContentTemplate>
                                                            <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                                <tr>
                                                                    <td style="width: 220px;" align="right">&nbsp;
                                                                        
                                                                    </td>
                                                                    <td align="left">
                                                                        <asp:Button ID="btnComputeTariff" runat="server" Text="NEXT" CssClass="ButtonStyle" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </ContentTemplate>
                                                    </asp:UpdatePanel>
                                                </td>
                                            </tr>
                                            <tr id="rowGridTariff" runat="server" visible="false">
                                                <td colspan="2">
                                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                        <tr>
                                                            <td colspan="2" align="center">
                                                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                                    <tr>
                                                                        <td style="width: 220px;" align="right">
                                                                            <asp:Label ID="lbTariff" runat="server" SkinID="lbtxt" Text="Tariff :"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                            <asp:Button ID="btnTariff" runat="server" Text="ค้นหา Tariff" CssClass="ButtonStyle" />
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="2" align="center">
                                                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                                    <tr>
                                                                        <asp:GridView ID="gridTariff" runat="server" SkinID="gridblueNoPage" DataKeyNames="MATERIAL,Text_line,Unit,Count,MAT_Default,KBETR,KONWA,MAT_Relation,MAT_ComputeM"
                                                                            AutoGenerateColumns="False">
                                                                            <Columns>
                                                                                <asp:BoundField HeaderText="รหัส" DataField="MATERIAL" />
                                                                                <asp:BoundField HeaderText="ชื่อ" DataField="Text_line" ItemStyle-HorizontalAlign="Center" />
                                                                                <asp:BoundField HeaderText="จำนวน" DataField="Count" ItemStyle-HorizontalAlign="Center" />
                                                                                <asp:BoundField HeaderText="หน่วย" DataField="Unit" ItemStyle-HorizontalAlign="Center" />
                                                                                <asp:TemplateField HeaderText="Owner1" ItemStyle-Width="60px" Visible="false" ItemStyle-HorizontalAlign="Center">
                                                                                    <ItemTemplate>
                                                                                        <asp:CheckBox ID="chkOwner1" runat="server" Checked="true" />
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="Owner2" ItemStyle-Width="60px" Visible="false" ItemStyle-HorizontalAlign="Center">
                                                                                    <ItemTemplate>
                                                                                        <asp:CheckBox ID="chkOwner2" runat="server" />
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="Owner3" ItemStyle-Width="60px" Visible="false" ItemStyle-HorizontalAlign="Center">
                                                                                    <ItemTemplate>
                                                                                        <asp:CheckBox ID="chkOwner3" runat="server" />
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="Owner4" ItemStyle-Width="60px" Visible="false" ItemStyle-HorizontalAlign="Center">
                                                                                    <ItemTemplate>
                                                                                        <asp:CheckBox ID="chkOwner4" runat="server" />
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="Owner5" ItemStyle-Width="60px" Visible="false" ItemStyle-HorizontalAlign="Center">
                                                                                    <ItemTemplate>
                                                                                        <asp:CheckBox ID="chkOwner5" runat="server" />
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="Owner6" ItemStyle-Width="60px" Visible="false" ItemStyle-HorizontalAlign="Center">
                                                                                    <ItemTemplate>
                                                                                        <asp:CheckBox ID="chkOwner6" runat="server" />
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="ลบ" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
                                                                                    <ItemTemplate>
                                                                                        <asp:ImageButton ID="imgdelete" CommandName="cmddelete" CommandArgument="<%# Container.DataItemIndex %>"
                                                                                            OnClientClick="showConfirm(this); return false;" runat="server" ImageUrl="~/Image/cancel-24.gif" />
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                            </Columns>
                                                                        </asp:GridView>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                            <tr>
                                                <td style="width: 220px;" align="right">&nbsp;
                                                    
                                                </td>
                                                <td align="left">
                                                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td align="left">
                                                                <asp:Button ID="btnUpdate" runat="server" Text="UPDATE" CssClass="ButtonStyle" Visible="false" />
                                                                <asp:Button ID="btnCompute" runat="server" Text="BOOKING" Width="140px" CssClass="ButtonStyle" />
                                                                <asp:Button ID="btnCancel" runat="server" Text="BACK" CssClass="ButtonStyle" />
                                                                <asp:Button ID="btnAddNew_Service" runat="server" Text="ขอเพิ่มบริการ" Visible="false"
                                                                    CssClass="ButtonStyle" />
                                                                <asp:Button ID="btnCopyBooking" runat="server" Text="COPY BOOKING" Visible="false" CssClass="ButtonStyle" style="margin-left:20px;" OnClientClick="return confirm('ยืนยันการ Copy Booking ?')" />
                                                            </td>
                                                            <td align="right">
                                                                <asp:Button ID="btnSaveCancelBooking" runat="server" Style="display: none;" />
                                                                <asp:Button ID="btnCancelBooking" runat="server" Text="CANCEL BOOKING" Width="140px"
                                                                    CssClass="ButtonStyle" />&nbsp;
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                </tr>
            </table>
            <asp:Button ID="btnLoad" runat="server" Text="Button" Style="display: none" />
            <asp:Button ID="btnTemp" runat="server" Text="Button" Style="display: none" />
            <asp:Button ID="BtnTrigger" runat="server" Text="Button" Style="display: none" />
            <asp:Button ID="btnSaveBooking" runat="server" Text="Button" Style="display: none" />
            <asp:Button ID="btnProductpopup" runat="server" Text="Button" Style="display: none" />
            <asp:Button ID="btnPayinTemp" runat="server" Text="Button" Style="display: none" />
            <asp:Button ID="btnPopupDetail" runat="server" Text="Button" Style="display: none;" />
            <asp:Button ID="btnReLoad" runat="server" Text="Button" Style="display: none;" />
            <asp:Button ID="btnTriggerService" runat="server" Text="Button" Style="display: none;" />
            <asp:Button ID="btnNew_Service_LOAD" runat="server" Text="Button" Style="display: none;" />
            <asp:Button ID="btnTariffTemp" runat="server" Text="ButtoN" Style="display: none;" />
            <asp:Button ID="btnCancelBookingTemp" runat="server" Text="Button" Style="display: none;" />
            <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="Background"
                TargetControlID="btnTariffTemp" PopupControlID="PopupAdd">
            </asp:ModalPopupExtender>
            <asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" BackgroundCssClass="Background"
                TargetControlID="btnTemp" PopupControlID="PopupCompute">
            </asp:ModalPopupExtender>
            <asp:ModalPopupExtender ID="ModalPopupExtender4" runat="server" BackgroundCssClass="Background"
                TargetControlID="btnUpload" PopupControlID="PopupUpload">
            </asp:ModalPopupExtender>
            <asp:ModalPopupExtender ID="ModalPopupExtender5" runat="server" BackgroundCssClass="Background"
                TargetControlID="btnProductpopup" PopupControlID="PopupProduct">
            </asp:ModalPopupExtender>
            <asp:ModalPopupExtender ID="ModalPopupExtender9" runat="server" BackgroundCssClass="Background"
                TargetControlID="btnPopupDetail" PopupControlID="PanelDetailPopup">
            </asp:ModalPopupExtender>
            <asp:ModalPopupExtender ID="ModalPopupExtender3" BehaviorID="ModalPopupExtender3"
                runat="server" OkControlID="ctl00_contentplaceholder1_ConfirmDelete_btnOk" OnOkScript="okClick();"
                CancelControlID="ctl00_contentplaceholder1_ConfirmDelete_btnNo" OnCancelScript="cancelClick();"
                BackgroundCssClass="Background" DropShadow="false" PopupControlID="PanelConfirm"
                TargetControlID="BtnTrigger">
            </asp:ModalPopupExtender>
            <asp:ModalPopupExtender ID="ModalPopupExtender6" runat="server" BackgroundCssClass="Background"
                TargetControlID="btnCancelBookingTemp" PopupControlID="PanelCancel">
            </asp:ModalPopupExtender>
            <asp:ModalPopupExtender ID="ModalPopupExtenderService" runat="server" BackgroundCssClass="Background"
                TargetControlID="btnTriggerService" PopupControlID="PopupNew_Service">
            </asp:ModalPopupExtender>
            <asp:Panel ID="PopupAdd" runat="server" Style="display: none;">
                <table>
                    <tr>
                        <td>
                            <iframe runat="server" id="framePopup" class="Style-Iframe" marginheight="0px" marginwidth="0px">
                            </iframe>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="PopupNew_Service" runat="server" Style="display: none;">
                <table>
                    <tr>
                        <td>
                            <iframe runat="server" id="frameNew_Service" class="Style-Iframe" marginheight="0px"
                                marginwidth="0px"></iframe>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="PopupCompute" runat="server" Style="display: none;">
                <table>
                    <tr>
                        <td>
                            <iframe runat="server" id="framePopup2" marginheight="0px" class="Style-Iframe" marginwidth="0px">
                            </iframe>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="PopupUpload" runat="server" Style="display: none;">
                <table>
                    <tr>
                        <td>
                            <iframe runat="server" id="Iframe1" marginheight="0px" class="Style-Iframe" marginwidth="0px"
                                src="../FormPopup/UploadFile.aspx"></iframe>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="PanelDetailPopup" runat="server" Style="display: none;">
                <table>
                    <tr>
                        <td>
                            <iframe runat="server" id="IframeDetailPopup" marginheight="0px" class="Style-Iframe"
                                marginwidth="0px"></iframe>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="PopupProduct" runat="server" Style="display: none;">
                <table>
                    <tr>
                        <td>
                            <iframe runat="server" id="ProductPopup" marginheight="0px" class="Style-Iframe"
                                marginwidth="0px"></iframe>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="PanelCancel" runat="server" Style="display: none;">
                <table>
                    <tr>
                        <td>
                            <iframe runat="server" id="CancelPopup" marginheight="0px" class="Style-Iframe" marginwidth="0px">
                            </iframe>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="PanelConfirm" runat="server" Style="display: none;">
                <Confirm:Confirm1 ID="ConfirmDelete" runat="server"></Confirm:Confirm1>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%-- Make the completion list transparent and then show it --%> 
</asp:Content>
